package com.blt.car.me;

import android.view.View;
import android.widget.ListView;

import com.blt.car.R;
import com.blt.car.base.BaseFragment;
import com.blt.car.base.ViewHolder;
import com.blt.car.me.adapter.RechargeAdapter;
import java.util.List;

import blt.app_core.api.base.CoreEvent;
import blt.app_core.api.base.CoreManager;
import blt.app_core.api.purse.PayApi;
import blt.app_core.api.purse.bean.VoucherVo;

/**
 * 充值明细
 * Created by xgp
 * on 2017/6/13.
 */

public class RechargeFragment extends BaseFragment implements View.OnClickListener {

    private RechargeAdapter mAdapter;
    private ListView lvRecharge;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_recharge;
    }

    @Override
    protected void initData() {
        super.initData();
        CoreManager.getCore(PayApi.class).getVoucherDetail();
    }

    @Override
    protected void initView(ViewHolder holder) {
        lvRecharge = holder.get(R.id.lv_recharge);
        mAdapter = new RechargeAdapter(getActivity());
        lvRecharge.setAdapter(mAdapter);

    }


    @CoreEvent(coreClientClass = PayApi.class)
    public void onChargeList(List<VoucherVo> voucherVos) {
        mAdapter.addData(voucherVos);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {

        }
    }

}
